package com.作业.Day7;

public class Homework7 {
    public static void main(String[] args) {
        System.out.println("计算机的信息如下");
        USB cpu= new CPU();
        USB  ram= new RAM();
        USB rom = new Rom();
        cpu.connect();
        ram.connect();
        rom.connect();
    }
}
interface USB{
     void connect();
}
class CPU implements USB{
    public void run(){
        System.out.println("CPU运行");

    }

    @Override
    public void connect() {
        System.out.println("CPU运行成功·");
    }
}
class  RAM implements USB{

    @Override
    public void connect() {
        System.out.println("硬盘成功·");
    }
    public void run(){
        System.out.println("硬盘成功CPU运行");

    }
}
class Rom  implements USB{
    public void run(){
        System.out.println("内存运行");

    }
    @Override
    public void connect() {
        System.out.println("内存运行成功·");
    }
}

